package com.lightsaber.trade.as.service.category;

import java.util.List;
import java.util.Map;

import org.springside.modules.orm.Page;

import com.lightsaber.trade.as.entity.category.Category;
import com.lightsaber.trade.as.service.param.ParamObject;
import com.lightsaber.trade.core.service.BaseService;

public interface CategoryService extends BaseService<Category, String> {

    public void saveCategory(Category category) throws Exception;

    public void createForMasterTree(final Category category) throws Exception;

    public List<Category> search(Category category);

    public Category findById(String id);

    public void deleteById(String id) throws Exception;

    public Page<Category> findPage(final Category category, final Page<Category> page,
            String[] roles, boolean isAdmin);

    public void createCategoryFromPage(final Category category) throws Exception;

    public Category saveAsNew(String categoryId, String branchName) throws Exception;

    public Category saveAsNewWithPlanning(final String categoryId, final String branchName)
            throws Exception;

    public List<Category> findBranchTreesByYearAndRole(Integer exerciseYear, String role);

    public List<Category> findBranchTreesByYearAndRoleForPlanner(final Integer exerciseYear,
            final String role);

    public List<Category> getBranchTreesByRole(String role);

    public Map<Integer, String> getAllCategoryOrderByYear();

    public void validateCategory(final Category category) throws Exception;

    public Category findMasterTreeByPlanYear(final Integer planYear) throws Exception;

    public List<ParamObject> findMasterTrees();

    public List<Category> findMasterTreeList();

    List<ParamObject> getPlanYearWithSlashList();
}
